package com.cloudcc.mobile.messagecent;

import com.cloudcc.cloudframe.net.async.EventRequest;
import com.cloudcc.mobile.dao.BaseEngine;
import com.cloudcc.mobile.event.BeauEventList;
import com.loopj.android.http.RequestParams;

import java.util.List;

/**
 * Created by Administrator on 2017/9/28.
 */

public class TongzhiImpl extends BaseEngine {
    //获取通知中心的消息数据
    public void tongzhiDate (BeauEventList.BeauTongzhiEvent Event) {
        EventRequest<List<BeauTongzhi>> eventRequest = new EventRequest<List<BeauTongzhi>>() { };
        eventRequest.setEvent(Event);
        RequestParams params = new RequestParams();
        params.put("messagetype", "notification");
        sendPost(params, "queryPushMessage", eventRequest);
    }
    //已读未读消息设置
    public void tongzhiNum (String id,BeauEventList.BeauTongzhiEvent Event) {
        EventRequest<List<BeauTongzhi>> eventRequest = new EventRequest<List<BeauTongzhi>>() { };
        eventRequest.setEvent(Event);
        RequestParams params = new RequestParams();
        params.put("id",id);
        sendPost(params, "deleteReadMessage", eventRequest);
    }

    //获取通知中心的未读消息数量
    public void queryUnRead (BeauEventList.BeauTongzhiEvent Event) {
        EventRequest<List<BeauTongzhi>> eventRequest = new EventRequest<List<BeauTongzhi>>() { };
        eventRequest.setEvent(Event);
        RequestParams params = new RequestParams();
        sendPost(params, "queryUnReadMessage", eventRequest);
    }

}
